package pref.junx.flybird.fragment.daily.fri;

import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.view.MenuItem;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import pref.junx.flybird.R;
import pref.junx.flybird.adapter.SimpleAdapter_fri;
import pref.junx.flybird.base.BaseFragment;
import pref.junx.flybird.entity.User_idea;


/**
 * Created by acer on 2017/8/4.
 */

public class FriFragment extends BaseFragment<FriPresenter, FriModlel> implements FriContract.View, PopupMenu.OnMenuItemClickListener {
    RecyclerView recyclerView;
    private List data = new ArrayList<User_idea>();
    private DefaultItemAnimator animator;
    private SimpleAdapter_fri adapter;
    public List<User_idea> eventList=new ArrayList<>();
    @Override
    public int getLayoutId() {
        return R.layout.fragment_fri;
    }

    @Override
    public void initView() {

    }


    @Override
    protected void init() {
        presenter.getFri(spTools.getInt("user_id"));
    }



    @Override
    public void reportsuccess(String a, int b) {


    }

    @Override
    public void reportfail(String a) {
        ts.show_l("上报失败");
    }

    @Override
    public void itmeSelect(String i, String n) {

    }

    @Override
    public void setFris(List<User_idea> data) {
        recyclerView=(RecyclerView)getActivity().findViewById(R.id.recyclerview_fri);
        recyclerView.setHasFixedSize(true);
        recyclerView.setItemAnimator(animator);
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        adapter = new SimpleAdapter_fri(getActivity(), data);
        recyclerView.setAdapter(adapter);
    }


    @Override
    public void onClick(View v) {


    }


    @Override
    public boolean onMenuItemClick(MenuItem item) {
        return false;
    }
//    void intdata(){
//        User_idea user=new User_idea();
//        user.setUser_nick("罗翔文");
//        user.setPhone("18094152314");
//        data.add(user);
//        User_idea user1=new User_idea();
//        user1.setUser_nick("柯哲新");
//        user1.setPhone("18094125314");
//        data.add(user1);
//        User_idea user2=new User_idea();
//        user2.setUser_nick("柯哲旧");
//        user2.setPhone("18094125314");
//        data.add(user2);
//        User_idea user3=new User_idea();
//        user3.setUser_nick("吴彦祖");
//        user3.setPhone("18094146584");
//        data.add(user3);
//        User_idea user4=new User_idea();
//        user4.setUser_nick("碧梅");
//        user4.setPhone("18094123455");
//        data.add(user4);
//        User_idea user5=new User_idea();
//        user5.setUser_nick("孙诗灵");
//        user5.setPhone("18094156890");
//        data.add(user5);
//        User_idea user6=new User_idea();
//        user6.setUser_nick("罗翔武");
//        user6.setPhone("18094152314");
//        data.add(user6);
//        User_idea user7=new User_idea();
//        user7.setUser_nick("彭于晏");
//        user7.setPhone("18094152314");
//        data.add(user7);
//        User_idea user8=new User_idea();
//        user8.setUser_nick("陈冠希");
//        user8.setPhone("18094152314");
//        data.add(user8);
//        User_idea user9=new User_idea();
//        user9.setUser_nick("陈道明");
//        user9.setPhone("18094152314");
//        data.add(user9);
//
//    }
}
